package com.demo.steammanagement.enums;

public enum GameCategoryEnum {
    LOW_LEVEL("1", "低级游戏"),
    HIGH_LEVEL("2", "高级游戏");

    private final String code;
    private final String description;

    GameCategoryEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    // 根据code获取对应的枚举值
    public static GameCategoryEnum fromCode(String code) {
        for (GameCategoryEnum category : GameCategoryEnum.values()) {
            if (category.getCode().equals(code)) {
                return category;
            }
        }
        throw new IllegalArgumentException("Unknown game category code: " + code);
    }
}